package com.qf.common.core.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * --- 缘分让我们相遇乱世以外 ---
 *
 * @author SJY
 *
 */
@Data // lombok注解，自动生成get/set方法
@TableName("user") // 表名
public class User {
    @TableId(type = IdType.AUTO)
    private Integer id;
    @NotBlank(message = "请输入用户名")
    @Size(min = 1, max = 50, message = "用户名长度必须在3到50个字符之间")
    private String username;
    @NotBlank(message = "请输入密码")
    @Size(min = 6, message = "密码长度不能少于6个字符")
    private String password;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") // 日期格式化
    private Date updateTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") // 日期格式化
    private Date createTime;
    private String phone;
    private String gender;
    private String avatar;
    private Integer point;
    private String inviteCode;
    private String inviteUid;
}
